<template>
  <div class="card-page">

    <el-tabs v-model="$data.type" type="card" ref="results">
      <el-tab-pane label="ES|QL导出" name="esql">

        <exp :data="$data.info" type="esql"></exp>

      </el-tab-pane>

      <el-tab-pane label="导出" name="export">

       <exp :data="$data.info" type="user"></exp>

      </el-tab-pane>

      <el-tab-pane label="导入" name="import">

         <impt :data="$data.info"></impt>

      </el-tab-pane>


    </el-tabs>

  </div>
</template>

<script setup>
/**
 * Created by CodeGenerator  at 2021-03-15 10:31:23
 */
import exp from "./export.vue";
import impt from "./import.vue";

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();


const $props = defineProps({
  id: {type: String, default: ""},
  action: {type: String, default: ""}
});

const $data = reactive({"type": $props.action, info: {}});


const loadData = async () => {
  if (!$props.id) return;
  let res = await jv.$http.post("/dev/es-connection/detail/" + $props.id)
  $data.info = res.data.data;
}

onMounted(function () {
  loadData();
})



</script>
